﻿namespace BancoIdeal.Masters
{
    using System;
    using System.Collections.Generic;
    using System.Web.Security;

    public partial class SecuredDashboard : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                if (this.Session["cliente"] != null)
                {
                    Dictionary<string, string> cliente = Session["cliente"] as Dictionary<string, string>;
                    nombreUsuario.Text = cliente["campNombreA"] + " " + cliente["campNombreB"] + " " + cliente["campApellidoA"] + " " + cliente["campApellidoB"];
                    this.IdCliente.Text = cliente["idCliente"];
                }
                else
                {
                    this.IdCliente.Text = "24";
                    nombreUsuario.Text = "Sergio Francisco Acosta Peláez";
                }
            }
        }

        protected void SalirClick(object sender, EventArgs e)
        {
            Session.Clear();
            Session.Abandon();
            FormsAuthentication.SignOut();
            Response.Redirect("~/");
        }
    }
}